package com.mall.aop;

import com.mall.vo.SysResult;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class SysResultException {

    @ExceptionHandler(RuntimeException.class)
    public Object exception(Exception e){
        e.printStackTrace();    //日志记录/控制台输出. 让程序员知道哪里报错!!!
        return SysResult.fail();
    }

}
